/*
 * 
 * 
 */
package recognizer;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import recognizer.Recognizer;

/**
 *
 * @author Sam Jenkins
 */
public class Main {

    private static String syntax = null;
    private static boolean valid = false;// false until proven true

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        /*
         * TO DO:  Check for args
         * 
         */
        boolean loop = true;
        try {
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
            while (loop) {
                System.out.print("Enter a line:");
                //System.out.println(bufferedReader.readLine());
                syntax = bufferedReader.readLine();
                if (syntax.length() > 0) {
                    Recognizer recognizer = new Recognizer();
                    valid = recognizer.isSyntaxValid(syntax);
                    if (valid) {
                        System.out.println("*** Valid Syntax ***]");
                    } else {
                        System.out.println("--- Invalid Syntax ---");
                    }
                } else
                    loop = false;
            }
        } catch (IOException ex) {
            ex.printStackTrace();
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
